package com.loper7.base.utils;

import android.content.Context;
import android.graphics.Color;
import android.support.design.widget.Snackbar;
import android.view.Gravity;
import android.view.View;
import android.widget.Toast;

import es.dmoral.toasty.Toasty;


public class UIHelper {


    /**
     * Toast消息
     *
     * @param msg
     */
    public static Toast makeToast(Context cont, String msg) {
        return Toasty.info(cont, msg, Toast.LENGTH_SHORT);
    }

    public static Toast makeSuccessToast(Context cont, String msg) {
        return Toasty.success(cont, msg, Toast.LENGTH_SHORT, true);
    }

    public static Toast makeInfoToast(Context cont, String msg) {
        return Toasty.info(cont, msg, Toast.LENGTH_SHORT, true);
    }

    public static Toast makeWarringToast(Context cont, String msg) {
        return Toasty.warning(cont, msg, Toast.LENGTH_SHORT, true);
    }

    public static Toast makeErrorToast(Context cont, String msg) {
        return Toasty.error(cont, msg, Toast.LENGTH_SHORT, true);
    }

    /**
     * SnackBar消息
     *
     * @param msg
     */
    public static Snackbar makeSnackbar(View view, String msg) {
        return SnackbarUtil.ShortSnackbar(view, msg, SnackbarUtil.defaultX);
    }
}
